<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
	<title>input框自定义input事件</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>
    <div>
        <form action="">
            用户名：<input id="username" type="text" /><br/>
            密码：<input id="password" type="password" />
            <button>登录</button>
        </form>
    </div>
    <script>
        $("#username").on("input",function () {
            // alert("触发了input事件");
            console.log("触发了input事件");
        });
    </script>
</body>
</html>